package com.teradyne.merlin2.ui.client.activitymappers;

import com.google.gwt.activity.shared.Activity;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.place.shared.Place;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.teradyne.merlin2.ui.client.activities.OrderMenuActivity;
import com.teradyne.merlin2.ui.client.activities.TopMenuActivity;
import com.teradyne.merlin2.ui.client.places.HomePlace;
import com.teradyne.merlin2.ui.client.places.OrderPlace;

public class LeftSideActivityMapper implements ActivityMapper {

	private final Provider<OrderMenuActivity> orderMenuActivityProvider;
	private final Provider<TopMenuActivity> topMenuActivityProvider;
	
	@Inject
	public LeftSideActivityMapper(Provider<TopMenuActivity> topMenuActivityProvider, Provider<OrderMenuActivity> orderMenuActivityProvider) {
		this.topMenuActivityProvider = topMenuActivityProvider;
		this.orderMenuActivityProvider = orderMenuActivityProvider;
	}

	@Override
	public Activity getActivity(Place place) {
		if (place instanceof HomePlace) {

		} else if (place instanceof OrderPlace) {
			return orderMenuActivityProvider.get();
		}
		return null;
		
	}

}